#include "avz.h"

using namespace AvZ;

void Script()
{
    SetZombies({
        ZOMBIE,
        POLE_VAULTING_ZOMBIE,
        FOOTBALL_ZOMBIE,
        DANCING_ZOMBIE,
        ZOMBONI,
        JACK_IN_THE_BOX_ZOMBIE,
        DIGGER_ZOMBIE,
        POGO_ZOMBIE,
        BUNGEE_ZOMBIE,
        LADDER_ZOMBIE,
        CATAPULT_ZOMBIE,
        GARGANTUAR,
        GIGA_GARGANTUAR,
        DOLPHIN_RIDER_ZOMBIE,
        SNORKEL_ZOMBIE,
    });

    SelectCards({
        ICE_SHROOM,
        DOOM_SHROOM,
        COFFEE_BEAN,
        LILY_PAD,
        CHERRY_BOMB,
        PUFF_SHROOM,
        SUN_SHROOM,
        SCAREDY_SHROOM,
        FLOWER_POT,
        WALL_NUT,
    });

    SetTime(-599, 1);
    pao_operator.resetPaoList({
        {3, 1},
        {4, 1},
        {3, 3},
        {4, 3},
        {3, 5},
        {4, 5},
        {3, 7},
        {4, 7},
        {1, 5},
        {2, 5},
        {5, 5},
        {6, 5},
    });

    Card(LILY_PAD, 4, 9);
    ice_filler.start({{4, 9}});
    SetTime(0, 18);
    ice_filler.stop();

    for (auto wave : {1, 3, 4, 6, 8, 12, 13, 15, 17, 18}) {
        SetTime(-95, wave);
        pao_operator.pao({{2, 9}, {5, 9}});
    }

    for (auto wave : {2, 7, 11, 16}) {
        SetTime(-95, wave);
        pao_operator.pao({{2, 9}, {5, 9}, {2, 9}, {5, 9}});
    }

    for (auto wave : {4, 13}) {
        SetTime(602 - 100 - 198, wave);
        ice_filler.coffee();
    }
    for (auto wave : {5}) {
        SetTime(1150 - 200 - 373, wave);
        pao_operator.pao({{2, 9}, {5, 9}});
    }
    for (auto wave : {14}) {
        SetTime(1150 - 200 - 373 + 37, wave);
        pao_operator.pao({{2, 9}, {5, 9}});
    }

    for (auto wave : {10}) {
        SetTime(394 - 373, wave);
        pao_operator.pao({{2, 2}, {5, 2}});
        SetTime(318 - 100 - 198);
        Card({{LILY_PAD, 3, 9}, {DOOM_SHROOM, 3, 9}, {COFFEE_BEAN, 3, 9}});
        SetTime(301);
        Card(CHERRY_BOMB, 5, 9);
    }

    for (auto wave : {9}) {
        SetTime(-95, wave);
        pao_operator.pao({{2, 9}, {5, 9}});
        SetTime(602 - 100 - 198);
        ice_filler.coffee();
        SetTime(601 + 1150 - 200 - 373);
        pao_operator.pao({{2, 8.2375}, {5, 8.2375}});
        SetTime(601 + 1150 + 278);
        pao_operator.pao({{2, 8}, {5, 8}});
    }

    for (auto wave : {18}) {
        SetTime(602 - 100 - 198, wave);
        Card(COFFEE_BEAN, 3, 9);
    }
    for (auto wave : {19}) {
        SetTime(1150 - 200 - 373, wave);
        pao_operator.pao({{2, 9}, {5, 9}});
        SetTime(1150 - 95);
        pao_operator.pao({{2, 8.475}, {5, 8.475}});

        SetTime(2);
        Shovel(3, 9);
    }

    for (auto wave : {20}) {
        SetTime(-150, wave);
        pao_operator.pao(4, 7.5875);
        SetTime(-55);
        pao_operator.pao({{2, 9}, {5, 9}});
        SetTime(410 - 373);
        pao_operator.pao({{2, 9}, {5, 9}, {2, 9}, {5, 9}});
        SetTime(394 - 373);
        pao_operator.pao({{2, 2}, {5, 2}});
    }
}